<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	  xmlns:th="http://www.thymeleaf.org"
	  xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity4">
<head>
	<meta charset="utf-8">
	<title>layui</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<link rel="stylesheet" th:href="@{/js/layui-v2.4.5/layui/css/layui.css}" media="all" />
	<link rel="stylesheet" th:href="@{/css/public.css}" media="all" />
	<link rel="stylesheet" th:href="@{/js/public/dtree/dtree.css}" media="all" />
	<link rel="stylesheet" th:href="@{/js/public/dtree/font/dtreefont.css}" media="all" />
</head>
<body  style="-webkit-backface-visibility: hidden;">
<div id="demoTree" class="dtree" data-id="0" style="border:1px solid #000"></div>
<!--<form class="layui-form"  lay-filter="example">-->
	<!--<div id="demoTree" class="dtree" data-id="0" style="border:1px solid #000"></div>-->
		<!--&lt;!&ndash;<div class="layui-input-block">&ndash;&gt;-->
			<!--&lt;!&ndash;<ul id="demoTree" class="dtree" data-id="0" style="border:1px solid #000"></ul>&ndash;&gt;-->
		<!--&lt;!&ndash;</div>&ndash;&gt;-->
<!--</form>-->
<script th:src="@{/js/jquery-2.1.1.min.js}"></script>
<script th:src="@{/js/layui-v2.4.5/layui/layui.js}"></script>
<script th:src="@{/js/utils.js}"></script>
<script th:inline="javascript">

    var id = [[${id}]];
    var userId = [[${userId}]];

    layui.config({
        base: path+'/js/public/'
    }).extend({
        dtree: 'dtree/dtree',

    });
    layui.use(['form','laydate','dtree'], function(){
        var form = layui.form,
            layer = parent.layer === undefined ? layui.layer : parent.layer;
        $ = layui.jquery, dtree = layui.dtree,laydate = layui.laydate;

        /**
         * 初始化菜单树
         * */

        if(id==null){
            id ="";
		}
		if(userId==null)
            userId="";
        var DemoTree = dtree.render({
            elem: "#demoTree",
            type: "all",
            initLevel: "5",
            url:path+"/priv/getAllMenu?id="+id+"&userId="+userId,
            checkbar: true,
            checkbarType: "all",
            response: {statusCode: 0, rootName: "dataTree", treeId:"treeId"} // 这里指定了返回的数据格式，组件会根据这些值来替换返回JSON中的指定格式，从而读取信息
        });

    });

</script>

</body>
</html>